package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ScoreDetailsMapper;
import com.ruoyi.system.domain.ScoreDetails;
import com.ruoyi.system.service.IScoreDetailsService;

/**
 * 评分细则Service业务层处理
 *
 * @author zxx
 * @date 2025-01-14
 */
@Service
public class ScoreDetailsServiceImpl implements IScoreDetailsService
{
    @Autowired
    private ScoreDetailsMapper scoreDetailsMapper;

    /**
     * 查询评分细则
     *
     * @param id 评分细则主键
     * @return 评分细则
     */
    @Override
    public ScoreDetails selectScoreDetailsById(Long id)
    {
        return scoreDetailsMapper.selectScoreDetailsById(id);
    }

    /**
     * 查询评分细则列表
     *
     * @param scoreDetails 评分细则
     * @return 评分细则
     */
    @Override
    public List<ScoreDetails> selectScoreDetailsList(ScoreDetails scoreDetails)
    {
        return scoreDetailsMapper.selectScoreDetailsList(scoreDetails);
    }

    /**
     * 新增评分细则
     *
     * @param scoreDetails 评分细则
     * @return 结果
     */
    @Override
    public int insertScoreDetails(ScoreDetails scoreDetails)
    {
        scoreDetails.setCreateTime(DateUtils.getNowDate());
        return scoreDetailsMapper.insertScoreDetails(scoreDetails);
    }

    /**
     * 修改评分细则
     *
     * @param scoreDetails 评分细则
     * @return 结果
     */
    @Override
    public int updateScoreDetails(ScoreDetails scoreDetails)
    {
        scoreDetails.setUpdateTime(DateUtils.getNowDate());
        return scoreDetailsMapper.updateScoreDetails(scoreDetails);
    }

    /**
     * 批量删除评分细则
     *
     * @param ids 需要删除的评分细则主键
     * @return 结果
     */
    @Override
    public int deleteScoreDetailsByIds(Long[] ids)
    {
        return scoreDetailsMapper.deleteScoreDetailsByIds(ids);
    }

    /**
     * 删除评分细则信息
     *
     * @param id 评分细则主键
     * @return 结果
     */
    @Override
    public int deleteScoreDetailsById(Long id)
    {
        return scoreDetailsMapper.deleteScoreDetailsById(id);
    }
}
